var WXBizDataCrypt = require('./WXBizDataCrypt')

var appId = 'wx957a7a36dd7dd325'
var sessionKey = 'bfa00a9766b71c1034ee43ad514d6f9024b5e99e'
var encryptedData =`rEn3b6V/yoOJjCkDsC93QTn6+HGC78PEP82PX1tz1pO7n3Fo6UVv3kA7R1pqmiGkQmQFzZLPw8Me8sGjnTAKhj3mC9jyjlSJ0sKa4UTb0uRPHqm2Ylccfadm9l1zanBYN/t1mJIxAvioZBrHaoxdNL80Ef/X88FOBc8CXSzUJWPq7nMb/ojLXYywcuiDuOQsSm4/OHaxKzNRR7LDc7obIZSK3+3ZBYd85oahVvVgBnn+Zuz+oG/NUhp7Ha3fIi7OrS1MeW2kOT2mBacH4lnUFkhZPOApAkPqJAFu72b4vTfZsGnKfFvishBCgQle+HYSq2N7WRHii/0lktzVSAkKUhD5n/b4WxqYk/dwCpCrdDIsPqxpECO+gulPJyaeQyydjA+53HIJhk1G4kgVvh+lZg==`
var iv = 'r7BXXKkLb8qrSNn05n0qiA=='

var pc = new WXBizDataCrypt(appId, sessionKey)

var data = pc.decryptData(encryptedData , iv)

console.log('解密后 data: ', data)
// 解密后的数据为
//
// data = {
//   "nickName": "Band",
//   "gender": 1,
//   "language": "zh_CN",
//   "city": "Guangzhou",
//   "province": "Guangdong",
//   "country": "CN",
//   "avatarUrl": "http://wx.qlogo.cn/mmopen/vi_32/aSKcBBPpibyKNicHNTMM0qJVh8Kjgiak2AHWr8MHM4WgMEm7GFhsf8OYrySdbvAMvTsw3mo8ibKicsnfN5pRjl1p8HQ/0",
//   "unionId": "ocMvos6NjeKLIBqg5Mr9QjxrP1FA",
//   "watermark": {
//     "timestamp": 1477314187,
//     "appid": "wx4f4bc4dec97d474b"
//   }
// }
